﻿# -*- coding: utf-8 -*-
# 平均绩点的计算公式：课程学分1*绩点 + 课程学分2*绩点 + ... + 课程学分n*绩点) / (课程学分1 + 课程学分2 + ... + 课程学分n)
# 分数与绩点转换表
# 分数	    等级	    绩点
# 90-100	A	    4
# 85-89	    A-	    3.7
# 82-84	    B+	    3.3
# 78-81	    B	    3
# 75-77	    B-	    2.7
# 71-74	    C+	    2.3
# 66-70	    C	    2
# 62-65	    C-	    1.7
# 60-61	    D	    1.3
# 60以下	    F	    0

def ji_dian(fenshu):
    if 90 <= fenshu <= 100:
        return 4
    elif 85 <= fenshu <= 89:
        return 3.7
    elif 82 <= fenshu <= 84:
        return 3.3
    elif 78 <= fenshu <= 81:
        return 3
    elif 75 <= fenshu <= 77:
        return 2.7
    elif 71 <= fenshu <= 74:
        return 2.3
    elif 66 <= fenshu <= 70:
        return 2
    elif 62 <= fenshu <= 65:
        return 1.7
    elif 60 <= fenshu <= 61:
        return 1.3
    elif fenshu < 60:
        return 0

class Gong_shi:
    xuefen = 0
    def ji_suan(self, jidia):
        x = self.xuefen * jidia
        y = self.xuefen
        return x, y


kecheng = x2 = y2 = 0
while True:
    kecheng += 1
    a = ji_dian(int(input(f'输入第{kecheng}门课程分数：')))
    k1 = Gong_shi()
    k1.xuefen = int(input(f'输入第{kecheng}门课程学分：'))
    x1, y1 = k1.ji_suan(a)
    x2, y2 = x2+x1, y2+y1
    print('现在的平均绩点是：%.2f' % (x2/y2))
